package example;

import org.springframework.boot.Banner;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import java.util.ArrayList;
import java.util.List;


@Controller
public class HelloController {


    @RequestMapping("/index")
    public String index(){
        return "welcome";
    }
    @RequestMapping("/login")
    public String login(ModelMap modelMap){
        modelMap.addAttribute("param1", "页面页面看到我了吗?");
        return "login";
    }
    @RequestMapping("/getdata")
    @ResponseBody
    public List getdata(){
           List list=new ArrayList();
            list.add("1");
           list.add("2");
          list.add("3");
        list.add("4");
        return list;
    }
    @RequestMapping("/getOut")
    public ModelAndView getOut(){
        ModelAndView mv=new ModelAndView();
        mv.setViewName("login");
        return mv;
    }


   }